package com.yanqu.road.entity.activity.cat;

import java.util.ArrayList;
import java.util.List;

public class Element {

    private int type;

    //颜色或者形、真、理
    private int color;

    private int x;

    private int y;

    private int id;

    private int val;

    List<EleAttr> attrs = new ArrayList<>();

    public Element() {
    }

    public Element(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    public List<EleAttr> getAttrs() {
        return attrs;
    }

    public void setAttrs(List<EleAttr> attrs) {
        this.attrs = attrs;
    }

    public Element clone(){
        Element copy = new Element(this.x, this.y);
        copy.setType(this.type);
        copy.setId(this.id);
        List<EleAttr> eleAttrs = new ArrayList<>();
        for (EleAttr attr : this.attrs) {
            eleAttrs.add(attr.clone());
        }
        copy.setColor(this.color);
        copy.setAttrs(eleAttrs);
        copy.setVal(this.val);
        return copy;
    }
}
